let { db } = require('../tools');

module.exports = (req, res) => {
    // console.log(req.body);
    let { data } = req.body
    db.collection('wares')
        .insertOne(data)
            .then(data => {
                res.json({errno: 0, msg: '添加成功'})
            })
            .catch(err => res.json(err))
    
}